This was first measured in 240 BC by Eratosthenes. He found that the Sun’s rays went vertically down a well at Syene at noon in mid summer, while they made an angle of 7½o with a vertical stick at Alexandria, 800 km to the north. You can see from the diagram that 7½o is equivalent to 800 km of the Earth’s circumference, and therefore the Earth has a circumference of 38 400 (24 000 miles).
A very good result for those days.